package org.henau.PathCommand;

import java.util.Arrays;
import java.util.List;
// 6. 使用示例

public class NavigationSystem {
    public static void main(String[] args) {
        PathPlanner planner = new PathPlanner();
        RemoteControl control = new RemoteControl();

        // 创建原始路径
        List<Coordinate> originalPoints = Arrays.asList(
                new Coordinate(35.123456, 128.765432),
                new Coordinate(35.124567, 128.776543)
        );

        // 设置原始路径
        Path originalPath = new Path(originalPoints);
        planner.setPath(originalPath);

        // 创建新路径
        List<Coordinate> newPoints = Arrays.asList(
                new Coordinate(35.123456, 128.765432),
                new Coordinate(35.125678, 128.787654),
                new Coordinate(35.124567, 128.776543)
        );
        Path newPath = new Path(newPoints);

        // 设置并执行命令
        System.out.println("=== 执行路径调整命令 ===");
        control.setCommand(new AdjustPathCommand(planner, newPath));
        control.executeCommand();

        // 撤销命令
        System.out.println("\n=== 撤销路径调整 ===");
        control.undoCommand();
    }
}